package com.yj.ccs.abs;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
public class AbsApplication {

    private static final Logger logger = LoggerFactory.getLogger(AbsApplication.class);

	public static void main(String[] args) throws UnknownHostException {
	    SpringApplication application = new SpringApplication(AbsApplication.class);
        Environment environment = application.run(args).getEnvironment();

        logger.warn("\n" +
                        "----------------------------------------------------------\n" +
                        "\t瑞茂通ABS后端已启动\n" +
                        "\t配置文件:\t {}\n" +
                        "\t本地访问地址:\t http://127.0.0.1:{}\n" +
                        "\t外网访问地址:\t http://{}:{}\n" +
                        "----------------------------------------------------------\n",
                environment.getActiveProfiles()[0],
                environment.getProperty("server.port"),
                InetAddress.getLocalHost().getHostAddress(),
                environment.getProperty("server.port"));
	}
}
